package com.hxh.demo.controller;

import com.hxh.demo.entity.Userinfo;
import com.hxh.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/7/6 21:46
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/getuserbyid")
    public Userinfo getUserById(Integer id) {
        if (id == null) return null;
        return userService.getUserById(id);
    }
}
